package com.example.my_helper;

import android.annotation.SuppressLint;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MyMqttMessage {
    static int index = 0;
    String topic;
    int qos;
    boolean retained;
    String time;
    String message;
    String id;

    @SuppressLint("SimpleDateFormat")
    public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public MyMqttMessage(String topic, int qos, boolean retained, String message){
        this.topic = topic;
        this.qos = qos;
        this.retained = retained;
        this.message = message;
        this.time = simpleDateFormat.format(new Date(System.currentTimeMillis()));
        this.id = String.valueOf(index);
        index++;
    }
}
